<template>
	<view class="wrap">
		<u-form>
			<u-form-item label="账号">
				<u-input v-model="form.no" placeholder="学号/手机号" />
			</u-form-item>
			<u-form-item label="密码">
				<u-input v-model="form.pwd" placeholder="密码" password />
			</u-form-item>
		</u-form>
		<view style="padding:16rpx 0">
			<u-button type="primary" @click="submit">登录</u-button>
		</view>
	</view>
</template>
<script setup>
	import {
		ref
	} from 'vue'
	const form = ref({
		no: '',
		pwd: ''
	})

	function submit() {
		if (!form.value.no || !form.value.pwd) return uni.showToast({
			title: '请填写完整',
			icon: 'none'
		})
		uni.showToast({
			title: '登录成功(示例)',
			icon: 'success'
		});
		setTimeout(() => uni.navigateBack(), 600)
	}
</script>
<style scoped>
	.wrap {
		padding: 16rpx
	}
</style>
